#!/usr/bin/env bash

### plugin's build directory, use /tmp to avoid pitfalls with VM mounts
#PBD=/tmp/trident/build
PBD=.
sudo rm -rf ${PBD}/myplugin

docker build -t rootfsimage .
id=$(docker create rootfsimage true)
sudo mkdir -p ${PBD}/myplugin/rootfs
sudo docker export "$id" | sudo tar -x -C ${PBD}/myplugin/rootfs
docker rm -vf "$id"
docker rmi rootfsimage
